package com.abner.design.patterns.state;

/**
 * 不能抽奖状态(具体的状态角色，每个子类实现一个与 Context 的一个状态相关行为)
 * @author Administrator
 *
 */
public class NoRaffleState extends State {


    RaffleActivity activity;

    public NoRaffleState(RaffleActivity activity) {
        this.activity = activity;
    }

    @Override
    public void deductMoney() {
        System.out.println("扣除 50 积分成功，您可以抽奖了");
        activity.setState(activity.getCanRaffleState());
    }

    @Override
    public boolean raffle() {
        System.out.println("扣了积分才能抽奖喔！");
        return false;
    }

    @Override
    public void dispensePrize() {
        System.out.println("不能发放奖品");
    }
}
